QLibrary: fix deadlock caused by fix to QTBUG-39642
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 2 Aug 2020 08:49:03 +0000 (09:49 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 2 Aug 2020 08:49:03 +0000 (09:49 +0100)
commit6e64a9ae1c6df009bc9bb1b7930a85347159a04c
tree9020f316ba89533daba4fa2a0db48036f032da54
parentafc4cb5c5c5d4c20e2bf984d3efa49c9582a04fa
QLibrary: fix deadlock caused by fix to QTBUG-39642

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=276fa8383a753576
Last-Update: 2020-04-17

Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around
the entire load_sys(). We had reasoned that deadlocks would only occur if
the object creation in instance() recursed into its own instance(),
which was already a bug. But we had forgotten that dlopen()/
LoadLibrary() executes initialization code from the module being loaded,
which could cause a recursion back into the same QPluginLoader or
QLibrary object. This recursion is benign because the module *is* loaded
and dlopen()/LoadLibrary() returns the same handle.

Gbp-Pq: Name fix_qlibrary_deadlock.diff
src/corelib/plugin/qlibrary.cpp
src/corelib/plugin/qlibrary_unix.cpp
src/corelib/plugin/qlibrary_win.cpp